 
 function formatTime(val)
 {
 
 if(val)
 {
 var date=new Date(val);
        var day= date.getDate();
        var month=date.getMonth()+1;
        var year=date.getFullYear();
        var hour=date.getHours();
        var minute=date.getMinutes();
        var second=date.getSeconds();
         if(day<10)
        {
            day="0"+day;
        }
        if(month<10)
        {
            month="0"+month;
        }
        if(hour<10)
        {
            hour="0"+hour;
        }
         if(minute<10)
        {
            minute="0"+minute;
        }
         if(second<10)
        {
            second="0"+second;
        }
        return year+'-'+month+'-'+day+" "+hour+":"+minute+":"+second;
        
}
return "";
        
}